<<<<<<< HEAD
define(["jquery", "easy-admin"], function ($, ea) {
=======
define(["jquery", "easy-admin","echarts", "echarts-theme", "miniAdmin", "miniTab"], function ($, ea,echarts, undefined, miniAdmin, miniTab) {
>>>>>>> group_one

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'order/index',
        add_url: 'order/add',
        edit_url: 'order/edit',
        delete_url: 'order/delete',
        export_url: 'order/export',
        modify_url: 'order/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: 'checkbox'},
                    {field: 'id', title: '主键id'},
                    {field: 'order_id', title: '订单编号'},
<<<<<<< HEAD
                    {field: 'user_id', title: '用户id'},
                    //{field: 'goods_id', title: '商品id'},
                    {field: 'goods_nums', title: '购买数量'},
                    {field: 'goods_price', title: '商品单价'},
                    {field: 'goods_total', title: '商品总价'},
                    //{field: 'delivery_id', title: '配送方式id'},
                    {field: 'address_id', title: '地址id'},
                    {field: 'pay_id', title: '支付方式id'},
                    {field: 'remarks', title: '订单备注'},
                   // {field: 'is_collage', title: '是否拼团 0-否 1-是'},
                    //{field: 'is_store', title: '自提点id'},
                   // {field: 'is_write_off', title: '是否核销 0-否 1-是'},
                    {field: 'status', title: '订单状态', templet: ea.table.switch},
                    //{field: 'create_time', title: 'create_time'},
=======
                    {field: 'goods_id', title: '商品id'},
                    {field: 'user_id', title: '用户id'},
                    {field: 'delivery_id', title: '配送id'},
                    {field: 'order_status', title: '0 待付款 1 待发货 2 已发货 3 已完成 4 退款中  5 支付失败 6 揽件中 7 已退款'},
                    {field: 'create_time', title: '添加时间'},
                    {field: 'location_id', title: '地址id'},
                    {field: 'pay_id', title: '支付方式id'},
                    {field: 'pay_identity', title: '支付人身份'},
                    {field: 'pay_name', title: '支付人名称'},
                    {field: 'order_remarks', title: '订单备注'},
                    {field: 'write_off_code', title: '核销码'},
                    {field: 'writeoff_status', title: '核销状态 0 待核销 1  已核销',selectList: {0: '待核销', 1: '已核销'}, templet: ea.table.switch},
                    {field: 'goods_number', title: '购买数量'},
                    {field: 'mastet_id', title: '团长id'},
                    {field: 'is_collage', title: '是否拼团 0 否 1 是',selectList: {0: '否', 1: '是'}, templet: ea.table.switch},
                    {field: 'goods_prcie', title: '商品价格'},
                    {field: 'goods_total', title: '商品总价'},
                    {field: 'is_store', title: '自提id'},
>>>>>>> group_one
                    {width: 250, title: '操作', templet: ea.table.tool},
                ]],
            });

            ea.listen();
        },
<<<<<<< HEAD
=======
        welcome: function () {

            miniTab.listen();

            /**
             * 查看公告信息
             **/
            $('body').on('click', '.layuimini-notice', function () {
                var title = $(this).children('.layuimini-notice-title').text(),
                    noticeTime = $(this).children('.layuimini-notice-extra').text(),
                    content = $(this).children('.layuimini-notice-content').html();
                var html = '<div style="padding:15px 20px; text-align:justify; line-height: 22px;border-bottom:1px solid #e2e2e2;background-color: #2f4056;color: #ffffff">\n' +
                    '<div style="text-align: center;margin-bottom: 20px;font-weight: bold;border-bottom:1px solid #718fb5;padding-bottom: 5px"><h4 class="text-danger">' + title + '</h4></div>\n' +
                    '<div style="font-size: 12px">' + content + '</div>\n' +
                    '</div>\n';
                layer.open({
                    type: 1,
                    title: '系统公告' + '<span style="float: right;right: 1px;font-size: 12px;color: #b1b3b9;margin-top: 1px">' + noticeTime + '</span>',
                    area: '300px;',
                    shade: 0.8,
                    id: 'layuimini-notice',
                    btn: ['查看', '取消'],
                    btnAlign: 'c',
                    moveType: 1,
                    content: html,
                    success: function (layero) {
                        var btn = layero.find('.layui-layer-btn');
                        btn.find('.layui-layer-btn0').attr({
                            href: 'https://gitee.com/zhongshaofa/layuimini',
                            target: '_blank'
                        });
                    }
                });
            });

            /**
             * 报表功能
             */
            var echartsRecords = echarts.init(document.getElementById('echarts-records'), 'walden');
            var optionRecords = {
                title: {
                    text: '访问统计'
                },
                tooltip: {
                    trigger: 'axis'
                },
                legend: {
                    data: ['邮件营销', '联盟广告', '视频广告', '直接访问', '搜索引擎']
                },
                grid: {
                    left: '3%',
                    right: '4%',
                    bottom: '3%',
                    containLabel: true
                },
                toolbox: {
                    feature: {
                        saveAsImage: {}
                    }
                },
                xAxis: {
                    type: 'category',
                    boundaryGap: false,
                    data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
                },
                yAxis: {
                    type: 'value'
                },
                series: [
                    {
                        name: '邮件营销',
                        type: 'line',
                        stack: '总量',
                        data: [120, 132, 101, 134, 90, 230, 210]
                    },
                    {
                        name: '联盟广告',
                        type: 'line',
                        stack: '总量',
                        data: [220, 182, 191, 234, 290, 330, 310]
                    },
                    {
                        name: '视频广告',
                        type: 'line',
                        stack: '总量',
                        data: [150, 232, 201, 154, 190, 330, 410]
                    },
                    {
                        name: '直接访问',
                        type: 'line',
                        stack: '总量',
                        data: [320, 332, 301, 334, 390, 330, 320]
                    },
                    {
                        name: '搜索引擎',
                        type: 'line',
                        stack: '总量',
                        data: [820, 932, 901, 934, 1290, 1330, 1320]
                    }
                ]
            };
            echartsRecords.setOption(optionRecords);
            window.addEventListener("resize", function () {
                echartsRecords.resize();
            });
        },
>>>>>>> group_one
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
<<<<<<< HEAD
});
=======
});

>>>>>>> group_one
